var express = require( 'express' );
const axios = require( 'axios' );

var app = express();

const port = 3333;

app.get( '/info', function ( req, res, next ) {
    res.send( 'This is node port 3333' );
} )

app.get( '/upload', function ( req, res, next ) {
    axios.get( 'http://node-docker-upload:4444' )
         .then( function ( response ) {
             res.send('success: ' + response.data );
         } ).catch( function ( error ) {
             res.send('error: ' + error);
         } );
} )

app.listen( port, () => {
    console.log( 'start listening port: ' + port );
} );
